package com.jboost.modules.app.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Pattern;

@Data
@ApiModel(value="app登录请求体", description="验证码登录")
public class LoginDto {
    /**电话号码*/
    @ApiModelProperty(value = "phone")
    @NotEmpty(message = "手机号码不能为空")
    @Length(min = 11, max = 11, message = "手机号只能为11位")
    @Pattern(regexp = "^[1][3,4,5,6,7,8,9][0-9]{9}$", message = "手机号格式有误")
    private String phone;
    /**验证码*/
    @ApiModelProperty(value = "code")
    @NotEmpty(message = "短信验证码不能为空")
    private String code;
}
